import React from "react";
import { Select  } from "antd";

const XlSelect = ({options = [], dataLabel="label", dataValue="value", ...props}: any) => {
  const list = (options || []).map((v: { [x: string]: any; }) => ({
    ...v,
    label: v[dataLabel],
    value: v[dataValue]
  }));

  return (
    <Select
      {...props}
      options={list}
    />
  );
}
export default XlSelect;